<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/react.development.js"></script>
    <script src="lib/react-dom.development.js"></script>
    <script src="lib/babel.min.js"></script>
    <script src="lib/prop-types.min.js"></script>
</head>
<body>
    <div id="root"></div>
    <script type="text/babel">
        let {Component} = React
        class Demo extends Component{
            constructor(){
                super()
                this.state = {
                    msg:''
                }
            }

            handleChange = (ev) =>{
                this.setState({
                    msg:ev.target.value
                })
            }
            handleSubmit = (ev)=>{
                let {msg} = this.state;
                console.log(msg)
                ev.preventDefault();
            }

            render(){
                return (
                    <div>
                        <form onSubmit={this.handleSubmit}>
                            <label>姓名：
                                <textarea value={this.state.msg} onChange={this.handleChange}></textarea>
                            </label>
                            <button>提交</button>
                        </form>
                    </div>
                )
            }
        }

        ReactDOM.render(
            <Demo />,
            document.querySelector("#root")
        )

    </script>
</body>
</html>